﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace DO.Clustering
{
    /// <summary>
    /// representation of a node after cluster
    /// - point to children
    /// - point to self (ID)
    /// - distance
    /// - score
    /// </summary>
    [DataContract]
    public class Cluster
    {
        #region props
        private int _ClusterID;
        /// <summary></summary>
        [DataMember]
        public int ClusterID
        {
            get
            {
                return this._ClusterID;
            }
            set
            {
                this._ClusterID = value;
            }
        }


        private double _Distance;
        /// <summary></summary>
        [DataMember]
        public double Distance
        {
            get
            {
                return this._Distance;
            }
            set
            {
                this._Distance = value;
            }
        }

        private List<int> _DocIDs;
        /// <summary></summary>
        [DataMember]
        public List<int> DocIDs
        {
            get
            {
                return this._DocIDs;
            }
            set
            {
                this._DocIDs = value;
            }
        }

        private List<int> _ChildClusterIDs;
        /// <summary></summary>
        [DataMember]
        public List<int> ChildClusterIDs
        {
            get
            {
                return this._ChildClusterIDs;
            }
            set
            {
                this._ChildClusterIDs = value;
            }
        }

        private Dictionary<int, double> _SupportiveTermWeights;
        /// <summary></summary>
        [DataMember]
        public Dictionary<int, double> SupportiveTermWeights
        {
            get
            {
                return this._SupportiveTermWeights;
            }
            set
            {
                this._SupportiveTermWeights = value;
            }
        }
        #endregion

        /// <summary>
        /// default not connected node
        /// </summary>
        public Cluster()
        {
            _ClusterID = 0;
            _Distance = 1;
            _DocIDs = new List<int>();
            _ChildClusterIDs = new List<int>();
            _SupportiveTermWeights = new Dictionary<int, double>();
        }
    }
}
